export default function() {
  return {
    houseId: [
      { required: true, message: '请选择房屋', trigger: 'change' }
    ],
    premisesAddress: [
      { required: true, message: '请输入房屋地址', trigger: 'blur' }
    ],
    lesseeType: [
      { required: true, message: '请选择承租方式', trigger: 'change' }
    ],
    contactName: [
      { required: true, message: '请输入联系人姓名', trigger: 'blur' }
    ],
    contactPhone: [
      { required: true, message: '请输入联系人手机号', trigger: 'blur' },
      {
        validator: (rule, value, callback) => {
          if (!/^1[3456789]\d{9}$/.test(value)) {
            callback(new Error('请输入正确的手机号'))
          }
          callback()
        }, trigger: 'blur'
      }
    ],
    cardNumber: [
      { required: true, message: '请输入身份证号', trigger: 'blur' },
      {
        validator: (rule, value, callback) => {
          if (!/^\d{17}[\d|x|X]$/i.test(value)) {
            callback(new Error('请输入正确的身份证号'))
          }
          callback()
        }, trigger: 'blur'
      }
    ],
    enterpriseName: [
      { required: true, message: '请输入企业名称', trigger: 'blur' }
    ],
    socialCreditCode: [
      { required: true, message: '请输入社会统一信用代码', trigger: 'blur' },
      {
        pattern: /^(([0-9A-Za-z]{15})|([0-9A-Za-z]{18})|([0-9A-Za-z]{20}))$/,
        message: '请输入正确的社会统一信用代码',
        trigger: 'blur'
      }
    ],
    signingMode: [
      { required: true, message: '请选择签署方式', trigger: 'change' }
    ],
    contractType: [
      { required: true, message: '请选择合同类型', trigger: 'change' }
    ],
    contractTemplateId: [
      { required: true, message: '请选择合同模板', trigger: 'change' }
    ],
    // contractNumber: [
    //   { required: true, message: '请输入合同编号', trigger: 'blur' }
    // ],
    contractScanningList: [
      { required: true, message: '请上传合同扫描件', trigger: 'change' }
    ],
    busUserId: [
      { required: true, message: '请选择签约人', trigger: 'change' }
    ],
    signingTime: [
      { required: true, message: '请选择签约日期', trigger: 'change' }
    ],
    latestSigningTime: [
      { required: true, message: '请选择最晚签约日期', trigger: 'change' }
    ],
    lesseeSourceId: [
      { required: true, message: '请选择租客来源', trigger: 'change' }
    ],
    /* waterMeterReading: [
      { required: true, message: '请输入水表读数', trigger: 'blur' }
    ],
    electricityMeterReading: [
      { required: true, message: '请输入电表读数', trigger: 'blur' }
    ], */
    order: {
      checkInTime: [
        { required: true, message: '请选择开始日期', trigger: 'change' }
      ],
      checkOutTime: [
        { required: true, message: '请选择结束日期', trigger: 'change' }
      ],
      rentalMode: [
        { required: true, message: '请选择付款方式', trigger: 'change' }
      ],
      depositNumber: [
        { required: true, message: '请输入押付方式', trigger: 'blur' },
        {
          validator: (rule, value, callback) => {
            if (!this.form.order.depositNumber) {
              callback(new Error('请输入付几'))
            }
            if (!this.form.order.payNumber) {
              callback(new Error('请输入付几'))
            }
            callback()
          }, trigger: 'blur'
        }
      ],
      payNumber: [
        { required: true, message: '请输入付几', trigger: 'blur' }
      ],
      monthRent: [
        { required: true, message: '请输入月租金', trigger: 'blur' }
      ],
      rentDayType: [
        { required: true, message: '请选择收租日类型', trigger: 'change' }
      ],
      rentCollectionDate: [
        { required: true, message: '请输入收租日(天/号)', trigger: 'blur' },
        {
          validator: (rule, value, callback) => {
            if (this.form.order.rentCollectionDate <= 0) {
              callback(new Error('收租日不能小于等于0'))
            }
            if (this.form.order.rentCollectionDate > 31) {
              callback(new Error('收租日不能大于31'))
            }
            callback()
          }
        }
      ],
      billGenerationDate: [
        { required: true, message: '请输入账单生成日期(天)', trigger: 'blur' },
        {
          validator: (rule, value, callback) => {
            if (this.form.order.billGenerationDate <= 0) {
              callback(new Error('账单生成日期不能小于等于0'))
            }
            if (this.form.order.billGenerationDate > 31) {
              callback(new Error('账单生成日期不能大于31'))
            }
            callback()
          }
        }
      ],
      billGenerationType: [
        { required: true, message: '请选择账单生成规则', trigger: 'change' }
      ],
      deposit: [
        { required: true, message: '请输入押金', trigger: 'blur' }
      ],
      totalRent: [
        { required: true, message: '请输入总租金', trigger: 'blur' }
      ]
    },
    contractFacilitiesItemList: [
      { required: true, message: '请添加房屋设施', trigger: 'change' }
    ],
    houseBillItemMergeList: [
      { required: true, message: '请添加房屋账单加收费用', trigger: 'change' }
    ]

  }
}
